﻿using System.Runtime.Serialization;
using UnityEngine;
using UnityEngine.Scripting;

namespace GMME.Model.Rtm.Req
{
    [DataContract]
    public class GetRtmChannelHistoryMessagesReq
    {
        /**
         * 开发者传入的频道Id
         */
        [DataMember(Name = "channelId")]
        [Preserve]
        public string ChannelId { get; set; }

        /**
         * 查询消息开始时间
         */
        [DataMember(Name = "startTime")]
        [Preserve]
        public long StartTime { get; set; }

        /**
         * 查询消息数量
         */
        [DataMember(Name = "count")]
        [Preserve]
        public int Count { get; set; }

#if UNITY_ANDROID
        public static AndroidJavaObject ConvertGetRtmChannelHistoryMessagesReq(GetRtmChannelHistoryMessagesReq req)
        {
            var androidJavaObject =
                new AndroidJavaObject("com.huawei.game.gmme.model.rtm.GetRtmChannelHistoryMessagesReq");
            androidJavaObject.Set("channelId", req.ChannelId);
            androidJavaObject.Set("startTime", req.StartTime);
            androidJavaObject.Set("count", req.Count);
            return androidJavaObject;
        }
#endif
    }
}